package com.onlocation.objects;

/**
 * Author: Steve Carrell
 * Date: 5/12/12
 */
public class Coordinate {
    private double longitude;
    private double latitude;
    private float radius;

    public Coordinate() {
        longitude = 0.0;
        latitude = 0.0;
        radius = 0.0f;
    }

    public Coordinate(double longitude, double latitude, float radius) {
        this.longitude = longitude;
        this.latitude = latitude;
        this.radius = radius;
    }

    public boolean equals(Coordinate coordinate) {
        return longitude == coordinate.longitude &&
                latitude == coordinate.latitude &&
                radius == coordinate.radius;
    }

    public void setLongitude(double longitude) {
        this.longitude = longitude;
    }

    public double getLongitude() {
        return longitude;
    }

    public void setLatitude(double latitude) {
        this.latitude = latitude;
    }

    public double getLatitude() {
        return latitude;
    }

    public void setRadius(float radius) {
        if (radius >= 0.0f) {
            this.radius = radius;
        } else {
            this.radius = 0.0f;
        }
    }

    public float getRadius() {
        return radius;
    }
}
